package com.travel.controller;

import com.qianfeng.util.ResultMsg;
import com.travel.service.GateOrderService;
import com.travel.service.HomeOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admingateOder")
public class AdminGateOrderController {

    @Autowired
    GateOrderService gateOrderService;


    /**
     * 查询所有门票订单
     * */
    @GetMapping("/getAll")
    public ResultMsg getAll(){
        return gateOrderService.seleteAll();
    }

    /**
     * 查询所有门票订单(分页)
     * */
//    @GetMapping("/getAllByPage")
//    public ResultMsg getAllByPage(@RequestParam Integer current, @RequestParam Integer size){
//        return gateOrderService.seleteAllByPage(current,size);
//    }

    @GetMapping("/getAllByPage")
    public ResultMsg strstegyGetdAll(@RequestParam(required = false,defaultValue = "1") int current, @RequestParam(required = false,defaultValue = "1") int size){
        return gateOrderService.seleteAllByPage(current,size);
    }

    /**
     * 通过ID查询单个门票订单
     * */
    @GetMapping("/getOneById")
    public ResultMsg getOneById(Integer gateOrderId){
        return gateOrderService.seleteOneById(gateOrderId);
    }

}